<?php 
    namespace Mark\Repository;
    
    class MarkAlbumRepository extends AbstractRepository {
        protected  $entity="Mark\\Entity\\MarkAlbum";
        


        
        
        public function listByAlbum($idAlbum, $maxResult=null){
            $dql = "SELECT c FROM $this->entity c JOIN c.album p WHERE p.id = ?1";
            $query = $this->getEntityManager()->createQuery($dql)
                ->setParameter(1, $idAlbum);
            if($maxResult!=null && $maxResult>0) $query->setMaxResults($maxResult);
            return $query->getResult();
        }
        
        
    }
